export default{
    inserted: function (el,binding) {
        function f() {

            var H = window.innerHeight;
            var st = document.body.scrollTop || document.documentElement.scrollTop;
            var ot = el.offsetTop;

            if (st + H > ot + 100) {

                // 加载图片
                var i = new Image();
                i.src = binding.value;
                i.onload = function () {
                    el.src = binding.value;
                }

                window.removeEventListener("scroll", f);
            }

        }
        el.src = "";
        f();
        window.addEventListener("scroll", f)
    }
}